<html>
<head><meta charset="utf-8"><title>libc PR review · t-libs · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/index.html">t-libs</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html">libc PR review</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="206416968"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/206416968" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#206416968">(Aug 09 2020 at 23:43)</a>:</h4>
<p>Would this be an appropriate place to request review on a couple of libc PRs?<br>
<a href="https://github.com/rust-lang/libc/pull/1858">https://github.com/rust-lang/libc/pull/1858</a><br>
<a href="https://github.com/rust-lang/libc/pull/1859">https://github.com/rust-lang/libc/pull/1859</a></p>



<a name="206416979"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/206416979" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#206416979">(Aug 09 2020 at 23:43)</a>:</h4>
<p>(I have a crate that would like to use those, and I'd rather not have to reimplement them within the crate.)</p>



<a name="211217269"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217269" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217269">(Sep 25 2020 at 04:26)</a>:</h4>
<p>Anyone around who could take a look at a PR for the libc crate? I'm trying to unblock some changes to rust-lang/rust that depend on it.<br>
<a href="https://github.com/rust-lang/libc/pull/1899">https://github.com/rust-lang/libc/pull/1899</a></p>



<a name="211217358"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217358" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217358">(Sep 25 2020 at 04:28)</a>:</h4>
<p>I sure didn't know you could <code>cfg</code> <em>inside</em> of the link attribute.</p>



<a name="211217379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217379">(Sep 25 2020 at 04:28)</a>:</h4>
<p>It's important, because if you put it <em>outside</em> the link attribute it doesn't work.</p>



<a name="211217633"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217633" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217633">(Sep 25 2020 at 04:34)</a>:</h4>
<p>I suppose I always just assumed you'd cfg_attr, or put a cfg on the module holding the extern block</p>



<a name="211217732"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217732" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217732">(Sep 25 2020 at 04:37)</a>:</h4>
<p>I tried that, and the net result was those libraries not getting passed to the linker at all.</p>



<a name="211217745"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211217745" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Lokathor <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211217745">(Sep 25 2020 at 04:37)</a>:</h4>
<p>there's two hard problems in programming, and linking is one of them.</p>



<a name="211286040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211286040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Amanieu <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211286040">(Sep 25 2020 at 17:08)</a>:</h4>
<p>I think the <code>crt-static</code> feature isn't known until link-time, which is why this hackery is needed.</p>



<a name="211292050"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211292050" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211292050">(Sep 25 2020 at 17:58)</a>:</h4>
<p>Ah, that's a good point; it's a target feature, so it can be decided when you invoke the compiler, which is long after std has been built.</p>



<a name="211383417"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211383417" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> nagisa <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211383417">(Sep 26 2020 at 21:26)</a>:</h4>
<p><span class="user-mention silent" data-user-id="239881">Josh Triplett</span> <a href="#narrow/stream/219381-t-libs/topic/libc.20PR.20review/near/211217732">said</a>:</p>
<blockquote>
<p>I tried that, and the net result was those libraries not getting passed to the linker at all.</p>
</blockquote>
<p>interesting, that sounds like somewhat of a footgun, something I'd probably file a bug over.</p>



<a name="211386170"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211386170" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211386170">(Sep 26 2020 at 22:50)</a>:</h4>
<p>There is issue opened by <span class="user-mention" data-user-id="123856">@Vadim Petrochenkov</span> <a href="https://github.com/rust-lang/rust/issues/72510">https://github.com/rust-lang/rust/issues/72510</a></p>



<a name="211386461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/219381-t-libs/topic/libc%20PR%20review/near/211386461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> mati865 <a href="https://rust-lang.github.io/zulip_archive/stream/219381-t-libs/topic/libc.20PR.20review.html#211386461">(Sep 26 2020 at 22:59)</a>:</h4>
<p>To make it clear, <code>cfg</code> inside <code>#[link(...)]</code> is resolved at the when linking the library specified by <code>#[link(...)]</code> while "typical" <code>cfg</code> is resolved at the build time.</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>